# -*- coding: utf-8 -*-
# @Author: felix

from PytestApi.apirun_v8.parse.YamlCaseParser import yaml_Op
from PytestApi.apirun_v8.parse.ExcelCaseParser import excel_Op


def case_parser(case_type,case_dir):
    """

    :param case_type: 用例的类型：yaml，excel
    :param case_dir:  用例所在的文件夹
    :return:  调用方法是什么，返回的格式就是什么/ 返回 {"case_names":[], "case_infos": []}
    """


    if case_type == 'yaml':
        yaml_op = yaml_Op()
        return yaml_op.yaml_case_parser(case_dir)
    if case_type == 'excel':
        excel_op = excel_Op()
        return excel_op.excel_case_parser(case_dir)

    return {"case_names":[], "case_infos": []}


if __name__ == '__main__':
    case_data = case_parser('yaml',case_dir='/example')
    print(case_data)